import Vue from 'vue'
import Router from 'vue-router'
const Home = r => require.ensure([], () => r(require('@/components/page/Home')), 'Home')
const About = r => require.ensure([], () => r(require('@/components/page/About')), 'About')
const StorageProduct = r => require.ensure([], () => r(require('@/components/page/StorageProduct')), 'StorageProduct')
const TransportProduct = r => require.ensure([], () => r(require('@/components/page/TransportProduct')), 'TransportProduct')
const BoxProduct = r => require.ensure([], () => r(require('@/components/page/BoxProduct')), 'BoxProduct')
const Distribution = r => require.ensure([], () => r(require('@/components/page/Distribution')), 'Distribution')
//const Products = r => require.ensure([], () => r(require('@/components/page/Products')), 'Products')
const Support = r => require.ensure([], () => r(require('@/components/page/Support')), 'Support')
const Verification = r => require.ensure([], () => r(require('@/components/page/Verification')), 'Verification')
const MyCart = r => require.ensure([], () => r(require('@/components/page/MyCart')), 'MyCart')

Vue.use(Router)

export default new Router({
  routes: [
    //地址为空时跳转home页面
    {
      path: '',
      redirect: '/Home'
  },
    {
      path: '/Home',
      name: 'Home',
      component: Home
    },
    {
      path: '/About',
      name: 'About',
      component: About
    },
    // {
    //   path: '/Products',
    //   name: 'Products',
    //   component: Products
    // },
    {
      path: '/StorageProduct',
      name: 'StorageProduct',
      component: StorageProduct
    },
    {
      path: '/TransportProduct',
      name: 'TransportProduct',
      component: TransportProduct
    },
    {
      path: '/BoxProduct',
      name: 'BoxProduct',
      component: BoxProduct
    },
    {
      path: '/Distribution',
      name: 'Distribution',
      component: Distribution
    },
    {
      path: '/Support',
      name: 'Support',
      component: Support
    },
    {
      path: '/Verification',
      name: 'Verification',
      component: Verification
    },
    {
      path: '/MyCart',
      name: 'MyCart',
      component: MyCart
    }


  ]
})
